package com.zz.jdk8;

/**
 * @author zhr
 */
public class TString {
    public static void main(String[] args) {

        String s1=new String("kvill");

        String s2=s1.intern();

        System.out.println( s1==s1.intern() );

        System.out.println( s1+" "+s2 );

        System.out.println( s2==s1.intern() );
        System.out.println(s1 == s2);
        System.out.println(s1.equals(s2));
        System.out.println(((Object) s1).hashCode());
        System.out.println(s2.hashCode());

        System.out.println();
        System.out.println(new String("abc") == "abc");
        System.out.println(new String("abc") == new String("abc"));
        System.out.println((Object) new String("abc"));
        System.out.println((Object) "abc");
        System.out.println("zz" == "zz");
        System.out.println("zz" == "z" + "z");

    }
}
